<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Test Put</title>
<link rel="stylesheet" type="text/css" href="/static/js/lib/bootstrap/css/bootstrap.css" />
</head>
<body>
	<div class="container">
		<div class="alert alert-info">
			<div class="alert-title">添加用户</div>
			<form id="add-form" action="#" onsubmit="return false;">
				<input type="text" name="username" id="username" value="刘涛" />
				<input type="text" name="flexAttrs.name" id="name" value="111" />
				<input type="text" name="flexAttrs.age" id="age" value="222" />

				<button type="submit">提交</button>
			</form>
		</div>
		<div class="alert alert-warning">
			<div class="alert-title">所有用户 <a href="javascript:;" class="btn btn-danger batch-delete-btn">批量删除</a></div>
			<ul class="list-group">
				<li class="list-group-item" th:each="user: ${users}">
					<span th:text="${user.username}"></span>
					<a href="javascript:;" class="btn btn-link" th:data-id="${user.id}" th:text="*{user.username}"> </a>
					<span th:text="${#dates.format(user.createTime, 'yyyy-MM-dd HH:mm:ss')}"></span>  --> 
					<span th:text="${#dates.format(user.updateTime, 'yyyy-MM-dd HH:mm:ss')}"></span>
				</li>
			</ul>
			<div id="all-users"></div>
		</div>
		<div class="alert alert-success">
			<div class="alert-title">修改用户</div>
			<form id="edit-form" action="#" onsubmit="return false;">
				<input type="text" name="username" id="edit-username" value="" />
				<input type="text" name="flexAttrs.name" id="edit-name" value="111" />
				<input type="text" name="flexAttrs.age" id="edit-age" value="222" />
				<button type="submit">提交</button>
			</form>
		</div>
	</div>
	<script type="text/template" id="users-tmpl">
<table class="table table-bordered table-striped">
{{ _.each(users, function(n){ }}
<tr>
	<td><input type="checkbox" name="userId" id="userId_{{=n.id}}" value="{{=n.id}}"/></td>
	<td>{{=n.username}}</td>
	<td>{{=n.updateTime}}</td>
	<td>{{=n.createTime}}</td>
	<td>
		<a href="javascript:;" data-id="{{=n.id}}" data-name="{{=n.username}}" class="btn btn-default edit-btn">修改</a>
		<a href="javascript:;" data-id="{{=n.id}}" class="btn btn-danger delete-btn">删除</a>
	</td>
</tr>
{{ }); }}
</table>
	</script>
	<script type="text/javascript" src="/static/js/lib/jquery.min.js"></script>
	<script type="text/javascript" src="/static/js/lib/bootstrap/js/bootstrap.js"></script>
	<script type="text/javascript" src="/static/js/lib/underscore-min.js"></script>
	<script type="text/javascript" src="/static/index.js"></script>
</body>
</html>